import axios from 'axios';
import config from '../../../config';
async function getArticleById (id) {
  try {
    const url = `//${config.host}:${config.port}${config.api.article.get}`;
    const reponse = await axios.get(
      url,
      {
        params: {
          id,
        },
      },
    );
    if (reponse.status === 200) {
      return reponse.data;
    }
  } catch (e) {
    console.error(e);
    return e;
  }
}

export default {
  getArticleById,
};
